/**  
 * All rights Reserved, Designed By www.woniuxy.com
 * @Title:  Account.java   
 * @Package com.woniu.domain   
 * @Description:    Description  
 * @author: 蜗牛学院  
 * @date:   2019年8月29日 下午7:22:17
 * @user:   Administrator  
 * @version V1.0 
 * @Copyright: 2019 www.woniuxy.com Inc. All rights reserved. 
 * 注意：本内容仅限于成都蜗牛创想科技有限公司，禁止外泄以及用于其他的商业目
 */ 
package com.woniu.ssm.util;

import java.util.List;

/**
 * @author Administrator
 *
 */
public class PageBean {
	private int pageNow;
	private int pageCount;
	private int startIndex;
	private int pageSize;
	private int rowCount;
	private int lastPage;
	private int nextPage;
	private List<?> lists;
	/**
	 * @return the pageNow
	 */
	
	public int getPageNow() {
		if(this.pageNow == 0) {
			this.pageNow = 1;
		}
		return pageNow;
	}
	public PageBean() {
		super();
		// TODO Auto-generated constructor stub
	}
	public PageBean(int pageNow, int rowCount, List<?> lists) {
		super();
		this.pageNow = pageNow;
		this.rowCount = rowCount;
		this.lists = lists;
		if(this.getRowCount() % this.getPageSize() ==0) {
			this.pageCount = this.getRowCount()/this.getPageSize();
		}else {
			this.pageCount = this.getRowCount()/this.getPageSize()+1;
		}
	}
	/**
	 * @param pageNow the pageNow to set
	 */
	public void setPageNow(int pageNow) {
		this.pageNow = pageNow;
	}
	/**
	 * @return the pageCount
	 */
	public int getPageCount() {
		
		return pageCount;
	}
	/**
	 * @param pageCount the pageCount to set
	 */
	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}
	/**
	 * @return the startIndex
	 */
	public int getStartIndex() {
		this.startIndex = (this.getPageNow()-1)*this.getPageSize();
		return startIndex;
	}
	/**
	 * @param startIndex the startIndex to set
	 */
	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}
	/**
	 * @return the pageSize
	 */
	public int getPageSize() {
		this.pageSize = 2;
		return pageSize;
	}
	/**
	 * @param pageSize the pageSize to set
	 */
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	/**
	 * @return the rowCount
	 */
	public int getRowCount() {
		return rowCount;
	}
	/**
	 * @param rowCount the rowCount to set
	 */
	public void setRowCount(int rowCount) {
		this.rowCount = rowCount;
	}
	/**
	 * @return the lastPage
	 */
	public int getLastPage() {
		this.lastPage=this.getPageNow()-1;
		return lastPage;
	}
	/**
	 * @param lastPage the lastPage to set
	 */
	public void setLastPage(int lastPage) {
		this.lastPage = lastPage;
	}
	/**
	 * @return the nextPage
	 */
	public int getNextPage() {
		this.nextPage = this.getPageNow()+1;
		return nextPage;
	}
	/**
	 * @param nextPage the nextPage to set
	 */
	public void setNextPage(int nextPage) {
		this.nextPage = nextPage;
	}
	/**
	 * @return the lists
	 */
	public List<?> getLists() {
		return lists;
	}
	/**
	 * @param lists the lists to set
	 */
	public void setLists(List<?> lists) {
		this.lists = lists;
	}
	
}
